package com.lier.common.valid;

/**
 * @author liyd
 * @description 异常类型枚举
 * @date 2025/6/10 18:06
 */
public enum ExceptionTypeEnum {

    /**
     * 11: 商品模块
     * 12: 订单模块
     * 13: 购物车模块
     * 14: 物流模块
     * 15: 用户模块
     */

    /**
     * 未知异常
     */
    UNKNOW_EXCEPTION(10000, "未知异常"),
    /**
     * 参数校验异常
     */
    VALIDATE_EXCEPTION(10001, "参数校验异常"),
    VALID_SMS_CODE_EXCEPTION(10002, "短信验证码频率过高"),
    PRODUCT_UP_EXCEPTION(11000, "商品上架异常"),
    USER_EMAIL_EXIST(15000, "用户邮箱已存在"),
    USER_NAME_EXIST(15001, "用户名称已存在"),
    ACCOUNT_PASS_ERR_EXCEPTION(15002, "账号或密码错误"),
    ;

    private final int code;
    private final String message;

    ExceptionTypeEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
